#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'
ll dp[21][21] = {0};
/**
 * 记忆化搜索
 * @param n
 * @param r
 * @return
 */
ll f(int n, int r) {
    if (dp[n][r])return dp[n][r];
    if (r == 0 || n == r)return dp[n][r] = 1;
    return dp[n][r] = f(n - 1, r - 1) + f(n - 1, r);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    for (int n, r; cin >> n >> r;) {
        cout << f(n, r) << endl;
    }
    return 0;
}
